'use strict';
exports.main = async (event, context) => {
	//event为客户端上传的参数
	console.log('event : ', event)
	const db = uniCloud.database(); //代码块为cdb
	const collection = db.collection('userTable');
	
	let queryStringParameters = event.queryStringParameters
	
	let res = await collection.where({_id: queryStringParameters['_id']}).update({
		avatar:queryStringParameters['avatar'],
		nickName:queryStringParameters['nickName'],
	})
	
	return {
	    mesg: '保存成功',
	    code: 200
	}
};
